package com.example.filesynsystem.enums;

import org.springframework.http.HttpStatus;

public enum ErrorCode {
    FORBIDDEN_COMMOM(403_000,"Forbidden");

    private final int status;
    private final String msg;

    ErrorCode(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public int getStatus() {return status;}
    public String getMsg() {return msg;}

    public int getHttpStatus() {
        HttpStatus status = HttpStatus.valueOf(getStatus()/1000);
        return status.value();
    }
}
